package com.quectel.emp.controller.village;


import com.quectel.core.module.village.dto.VillageRoomDto;
import com.quectel.core.module.village.service.VillageRoomService;
import com.quectel.emp.controller.BaseController;
import com.quectel.util.common.Response;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author caolu
 * @email louis.cao@quectel.com
 * @date 2021-10-18 14:41:47
 */
@RestController
@RequestMapping("villageRoom")
@Tag(name = "VillageRoomController", description = "房间相关api")
public class VillageRoomController extends BaseController {

    @DubboReference
    private VillageRoomService villageRoomService;

    @GetMapping("queryByFloorId")
    @Operation(summary = "根据楼层筛选房屋")
    public Response<List<VillageRoomDto>> queryByFloorId(
            @Parameter(description = "楼层") @RequestParam Long floorId
    ) {

        return Response.<List<VillageRoomDto>>ok().wrap(villageRoomService.selectByFloorId(floorId));
    }
}
